變數常數命名


Posted by mijouhsieh on 2023-04-14

若儲存的資料不會變更,宣告常數名稱 字首大寫---以表示此特性。

const Symbols = [
  'https://assets-lighthouse.alphacamp.co/uploads/image/file/17989/__.png', // 黑桃
  'https://assets-lighthouse.alphacamp.co/uploads/image/file/17992/heart.png', // 愛心
  'https://assets-lighthouse.alphacamp.co/uploads/image/file/17991/diamonds.png', // 方塊
  'https://assets-lighthouse.alphacamp.co/uploads/image/file/17988/__.png' // 梅花
]

#宣告變數 #變數常數命名







Related Posts

極簡複習:函式和模組的 Python 程式範例

極簡複習:函式和模組的 Python 程式範例

為什麼寫在 label 上的 click 事件會觸發兩次?

為什麼寫在 label 上的 click 事件會觸發兩次?

[HTML BTS] 冒泡? 捕捉?Capturing & Bubbling in DOM Event

[HTML BTS] 冒泡? 捕捉?Capturing & Bubbling in DOM Event


Comments